<template>
  <view class="content">
    <view class="components-title">
      <view class="components-title-t">gg-code-sms</view>
      <view class="components-title-d">短信验证</view>
    </view>
    <gg-nav-group label="默认label">
      <gg-code-sms v-model="formData.code" mobile="19965990588" codeUrl="www.baidu.com" waitTime="6" />
    </gg-nav-group>
    <gg-nav-group label="自定义label">
      <gg-code-sms label="验证码" v-model="formData.code" />
    </gg-nav-group>
  </view>
</template>

<script>
export default {
  data() {
    return {
      formData: {
        code: '',
      },
    };
  },
  onLoad() {
    setTimeout(() => {
      this.testReqMocck().then((res) => {
        this.formData.code = '';
      });
      console.log('模拟请求数据', this.formData);
    }, 1000)
  },
  methods: {
    testReqMocck(testData) {
      return new Promise((resolve, reject) => {
        resolve({
        });
      });
    }
  }
}
</script>

<style>
page {
  background: #f1f1f1;
}
</style>
